package com.rds.system.service.impl;

import com.rds.common.utils.DateUtils;
import com.rds.system.domain.RdaFormDetails;
import com.rds.system.mapper.RdaFormDetailsMapper;
import com.rds.system.service.IRdaFormDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * form表单列Service业务层处理
 *
 * @author rds
 * @date 2021-04-19
 */
@Service
public class RdaFormDetailsServiceImpl implements IRdaFormDetailsService
{
    @Autowired
    private RdaFormDetailsMapper rdaFormDetailsMapper;

    /**
     * 查询form表单列
     *
     * @param id form表单列ID
     * @return form表单列
     */
    @Override
    public RdaFormDetails selectRdaFormDetailsById(Long id)
    {
        return rdaFormDetailsMapper.selectRdaFormDetailsById(id);
    }

    /**
     * 查询form表单列列表
     *
     * @param rdaFormDetails form表单列
     * @return form表单列
     */
    @Override
    public List<RdaFormDetails> selectRdaFormDetailsList(RdaFormDetails rdaFormDetails)
    {
        return rdaFormDetailsMapper.selectRdaFormDetailsList(rdaFormDetails);
    }

    /**
     * 根据名称查询列
     *
     * @param configName
     * @return table列集合
     */
    public List<RdaFormDetails> selectByConfigName(String configName)
    {
        return rdaFormDetailsMapper.selectByConfigName(configName);
    }

    /**
     * 新增form表单列
     *
     * @param rdaFormDetails form表单列
     * @return 结果
     */
    @Override
    public int insertRdaFormDetails(RdaFormDetails rdaFormDetails)
    {
        rdaFormDetails.setCreateTime(DateUtils.getNowDate());
        return rdaFormDetailsMapper.insertRdaFormDetails(rdaFormDetails);
    }

    /**
     * 修改form表单列
     *
     * @param rdaFormDetails form表单列
     * @return 结果
     */
    @Override
    public int updateRdaFormDetails(RdaFormDetails rdaFormDetails)
    {
        return rdaFormDetailsMapper.updateRdaFormDetails(rdaFormDetails);
    }

    /**
     * 批量删除form表单列
     *
     * @param ids 需要删除的form表单列ID
     * @return 结果
     */
    @Override
    public int deleteRdaFormDetailsByIds(Long[] ids)
    {
        return rdaFormDetailsMapper.deleteRdaFormDetailsByIds(ids);
    }

    /**
     * 删除form表单列信息
     *
     * @param id form表单列ID
     * @return 结果
     */
    @Override
    public int deleteRdaFormDetailsById(Long id)
    {
        return rdaFormDetailsMapper.deleteRdaFormDetailsById(id);
    }
}
